% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fixnames_to_type.R
\name{fixnames_to_type}
\alias{fixnames_to_type}
\title{helper function to change elements of namesnow from an oldtype to a newtype of names}
\usage{
fixnames_to_type(
  namesnow,
  oldtype = "apiname",
  newtype = "rname",
  mapping_for_names
)
}
\arguments{
\item{namesnow}{vector of strings, such as from colnames(x)}

\item{oldtype}{string with name of a column in data.frame mapping_for_names,
and that column has old column names that overlap with those in namesnow,
like "ejscreen_csv" aka "csvname2.2" or
like "ejscreen_api" aka "apiname" or
like "rname" maybe aka "newnames_ejscreenapi"}

\item{newtype}{string with name of a column in data.frame mapping_for_names,
like "rname" maybe aka "newnames_ejscreenapi" or
like  "longname_tableheader" or "shortlabel"
and that column has old column names that overlap with those in namesnow}

\item{mapping_for_names}{data.frame passed to \code{\link[=fixnames]{fixnames()}} to do the work
with colnames that are referred to by oldtype and newtype}
}
\value{
Vector or new column names same length as input
}
\description{
helps convert between original, friendly, and long versions of variable names
}
\details{
YOU NEED TO SPECIFY NAMES OF COLUMNS IN MAP_HEADERNAMES, like "apiname" or "rname",
UNLIKE IN fixnames() or fixcolnames() where you specify a type like "long" or "api"
Using lookup table mapping_for_names, finds each namesnow
in the column specified by oldtype
and replaces it with the corresponding string in the column specified by newtype
}
\seealso{
varinfo() from EJAM pkg, and \code{\link[=fixnames_to_type]{fixnames_to_type()}} \code{\link[=fixcolnames]{fixcolnames()}} \code{\link[=fixnames]{fixnames()}}
}
\keyword{internal}
